package com.kingsoft.miot.bridge.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.kingsoft.miot.bridge.service.HotelService;
import com.kingsoft.miot.bridge.service.RoomService;

/**
 * 房间控制
 * @author HUJIANQING
 *
 */
@RestController
@RequestMapping("/data/room/")
public class RoomController extends BaseController {

	private static final Logger LOGGER = LoggerFactory.getLogger(RoomController.class);
	
	@Autowired
	private HotelService hotelService;
	
	@Autowired
	private RoomService roomInfoService;
	
	/**
	 * 获取整个酒店中房间信息列表
	 * 
	 * @return
	 */
//	@RequestMapping(value = "/data/hotels/{id}/rooms/", method = RequestMethod.POST)
//	public String getHotelRoomListByHotelId(@PathVariable String id ,@RequestBody RoomRequest roomRequest) {
//		PageResult<RoomInfo> pageResult = null;
//		String jsonResult = CommonResult.jsonString();
//		try {
//			if (roomRequest.getHotel_id() <= 0) {
//				LOGGER.error("请求hotel_id 参数非法！");
//				return jsonResult;
//			}
//			pageResult = hotelService.findHotelRoomByPage(roomRequest.getHotel_id(), roomRequest.getPage(),
//					roomRequest.getSize(), roomRequest.getOrderList());
//		} catch (Exception e) {
//			LOGGER.error("未获取到房间信息列表。");
//		}
//		return pageResult == null ? jsonResult : JSON.toJSONString(pageResult);
//	}

	/**
	 * 获取酒店房间的详细信息
	 * 
	 * @param id
	 * @param room_id
	 * @return
	 */
//	@RequestMapping(value = "/data/hotels/{id}/rooms/{room_id}")
//	public String getRoomInfoByHotelIdAndRoomId(@PathVariable String id, @PathVariable String room_id) {
//		if (StringUtils.isAllBlank(new String[] { id, room_id })) {
//			LOGGER.error("hotel_id或者room_id为空。");
//		}
//		RoomInfo roomInfo = null;
//		String jsonResult = CommonResult.jsonString();
//		try {
//			roomInfo = hotelService.getRoomByHotelIdAndRoomId(Integer.valueOf(id), Integer.valueOf(room_id));
//		} catch (Exception e) {
//			LOGGER.error("获取room信息失败。");
//			return jsonResult;
//		}
//		return JSON.toJSONString(roomInfo);
//	}
	
	
	// 通过room id 查询room
	
	// 通过hotel id 查询room 
	
	// 通过hotel id 和 room id 查询room
	
	// 通过管理员查询相关的room
	
	// 通过区域查询相关的room
	
	// 查询所有的room
}
